/* //引入路由组件
import Search from '@/pages/search'
import Login from '@/pages/Login'
import Register from '@/pages/Register'
import Detail from "@/pages/Detail"
import AddCartSuccess from '@/pages/AddCartSuccess'
import ShopCart from '@/pages/ShopCart'
import Trade from '@/pages/Trade'
import Pay from '@/pages/Pay'
import PaySuccess from '@/pages/PaySuccess'
//引入二级路由
import Center from "@/pages/Center"
import GroupOrder from '@/pages/Center/groupOrder'
import MyOrder from '@/pages/Center/myOrder'
 */


export default [
    {
        path: '/home',
        //路由懒加载
        component: () => import('@/pages/Home/Home.vue'),
        meta: { show: true }
    },
    {
        name: 'search',
        path: '/search/:keyword?',
        component: () => import('@/pages/search'),
        meta: { show: true }
    },
    {
        path: '/login',
        component: () => import('@/pages/Login'),
        meta: { show: false }
    },

    {
        path: '/register',
        component: () => import('@/pages/Register'),
        meta: { show: false }
    },
    {
        path: '/detail/:skuId',
        component: () => import('@/pages/Detail'),
        meta: { show: true }
    },
    //重定向，让默认就到首页上跳
    {
        path: '/',
        redirect: '/home'
    },
    {
        name: 'addcartsuccess',
        path: '/addcartsuccess',
        component: () => import('@/pages/AddCartSuccess')

    },
    {
        name: 'shopcart',
        path: '/shopcart',
        component: () => import('@/pages/ShopCart'),
        meta: { show: true }
    },
    {
        name: 'trade',
        path: '/trade',
        component: () => import('@/pages/Trade')
    },
    {
        name: 'pay',
        path: '/pay',
        component: () => import('@/pages/Pay'),
        beforeEnter: (to, from, next) => {
            //只有是从trade订单来的才能进入pay支付路由
            if (from.path == '/trade') {
                next()
            } else {
                next(false)
            }
        }
    },
    {
        name: 'paysuccess',
        path: '/paysuccess',
        component: () => import('@/pages/PaySuccess')
    },
    {
        path: '/center',
        component: () => import('@/pages/Center'),
        children: [
            {
                path: 'myorder',
                component: () => import('@/pages/Center/myOrder')
            }, {
                path: 'grouporder',
                component: () => import('@/pages/Center/groupOrder')
            }, , {
                path: '',
                redirect: '/center/myorder'
            }
        ]
    },


]